//
//  AllBuyBottomView.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2019/1/2.
//  Copyright © 2019 Gox_WallyDiao. All rights reserved.
//

import UIKit
protocol BuyRightBtnDelegate:NSObjectProtocol {
    func BuyRightBtnAction()
}

class AllBuyBottomView: UIView {
    var delegate:BuyRightBtnDelegate?
    
    lazy var leftLabel:UILabel = {
        let label = UILabel.init(frame: FRAME_CGFloat(0, 0, SCREEN_WIDTH / 2, 54))
        label.font = FONT(18)
        label.textColor = RGB_Same(53)
        label.backgroundColor = WhiteBackColor
        label.textAlignment = .center
        return label
    }()
    
    lazy var rightBtn:UIButton = {
        let button = UIButton(type: UIButton.ButtonType.custom)
        button.frame = FRAME_CGFloat(SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2, 54)
        button.setTitle("购买全集", for: .normal)
        button.addTarget(self, action: #selector(buyBtnAction), for: .touchUpInside)
        button.backgroundColor = TabbarTintColor
        return button
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUI() {
        
        self.addSubview(leftLabel)
        self.addSubview(rightBtn)
        
    }
    
    @objc func buyBtnAction() {
        delegate?.BuyRightBtnAction()
    }

}
